package com.chenxin.design.strategy.demo1;

public class StrategyPatternDemo {
   public static void main(String[] args) {
      Context context = new Context(new AddStrategy());
      System.out.println("10 + 5 = " + context.executeStrategy(10, 5));
 
      context = new Context(new SubtractStrategy());
      System.out.println("10 - 5 = " + context.executeStrategy(10, 5));
 
      context = new Context(new MultiplyStrategy());
      System.out.println("10 * 5 = " + context.executeStrategy(10, 5));
   }
}